﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components.mainmenu {
    import reprise.ui.*;
    import flash.display.*;
    import reprise.controls.*;
    import net.wooga.pets.utils.*;

    public class InventoryScrollItem extends reprise.controls.SimpleButton {

        private const ASSET_PREFIX:String = "RC_";

        private var _background:UIComponent;
        private var _key:String;
        private var _numberOfItems:int;
        private var _numberLabel:Label;

        public function InventoryScrollItem(_arg1:String, _arg2:int){
            this._key = _arg1;
            this._numberOfItems = _arg2;
        }
        override protected function initialize():void{
            addCSSClass("scrollItem");
            super.initialize();
        }
        override protected function createChildren():void{
            this._background = addComponent("scrollItemBackground");
            var _local1:MovieClip = AssetsLibrary.getMovieClip((this.ASSET_PREFIX + this._key));
            _local1.scaleX = (_local1.scaleY = Numbers.scaleWithinRect(_local1.width, _local1.height, 50, 50));
            _local1.x = (_local1.x - (_local1.width / 2));
            _local1.y = (_local1.y - (_local1.height / 2));
            RepriseUtils.addClipComponent(this._background, "imageDisplay", _local1);
            this._numberLabel = RepriseUtils.addLabel(this._background, "nameLabel", String(this._numberOfItems));
        }
        public function get key():String{
            return (this._key);
        }
        public function set numberOfItems(_arg1:int):void{
            this._numberOfItems = _arg1;
            this._numberLabel.setLabel(String(this._numberOfItems));
        }

    }
}//package net.wooga.pets.views.components.mainmenu 
